 <#include "../common/head.ftl">
<!--contaniner-->
<div id="box">

 <!--search-->
 <div class="searchinfo">
 <form action="${base}/search" id="searchForm" name="searchForm" method="post">
 	<div class="lf">
          <ul>
              <li><span>学历</span><select name="education" id="education"></select></li>
              <li><span>一级专业</span><select name="major_list" id="major_list"></select></li>
              <li><span>二级专业</span><select name="child_major" id="child_major"><option selected='selected' value='0'>不限</option></select></li>
              <li><span>职位类型</span><select name="job_type" id="job_type"></select></li>
          </ul>
         <ul>
             <li><span>工作经验</span><select name="work_experience" id="work_experience"></select></li>
             <li><span>期望薪资</span><select name="salary" id="salary">
			    <#if salary == '1000-2000'>
			    <option selected value="0">不限</option>
				    <option value="1000-2000" selected>1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '2001-4000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000" selected>2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '4001-7000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000" selected>4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '7001-10000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000" selected>7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '10001-15000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000" selected>10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '15001-20000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000" selected>15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '20001-60000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000" selected>20001以上</option>
			    	<option value="1000-20000">面议</option>
				    <#elseif salary == '1000-20000'>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20000">20001以上</option>
				    <option value="1000-20000" selected>面议</option>
				    <#else>
				    <option selected value="0">不限</option>
				    <option value="1000-2000">1000-2000</option>
				    <option value="2001-4000">2001-4000</option>
				    <option value="4001-7000">4001-7000</option>
				    <option value="7001-10000">7001-10000</option>
				    <option value="10001-15000">10001-15000</option>
				    <option value="15001-20000">15001-20000</option>
				    <option value="20001-60000">20001以上</option>
			    	<option value="1000-20000">面议</option>
				    </#if>
			    </select>
			  </li>
             <li><span>期望城市</span><select name="city" id="city"></select></li>
         </ul>
     </div>
     <div class="rt">
          <ul>
              <li class="resetgray"><button type="button" onclick="search_reset()" >重置</button></li>
              <li class="soublue"><button type="button" onclick="search()">搜索</button></li>
          </ul>
     </div> 	
 </form>
 </div>
 <!--/.search-->
 
 <!--studentinfo-->
 <div class="listall">
  <ul>
   <li>
   <#if resume_list??>
   		<#list resume_list as ru>
   			<!--001-00N-->
		    <div class="studentinfo" onmouseover="ShowBorder(this)" onmouseout="HideBorder(this)">
		      <span class="studentinfo_l">
		      <#if enterpriseInit[0].ent_status=="0">
		      <a href="${base}/resume/r-${ru.stu_resume_id}.html?internships=${ru.internships}">
		      <#else>
		      <a href="javascript:void(0)" onclick="erroremergentMsg();">
		      </#if>
		       <!--  <p class="renew pt30">简历更新时间：<em>08-21</em></p>-->
		       <#if ru.salary=="0-0">
		       <#assign tmp_salary="">
		       <#elseif ru.salary=="20001-60000">
		       <#assign tmp_salary="20001以上">
		       <#elseif ru.salary=="1000-20000">
		       <#assign tmp_salary="面议">
		       <#else>
		       <#assign tmp_salary=ru.salary>
		       </#if>
		       <p class="pt30">${ru.full_name}    ${ru.sex}    ${(ru.job_type!="null")?string(ru.job_type,"")}</p>
		       <p>${(ru.age!="0")?string(ru.age+"岁","")}    ${ru.certificate_type}    ${tmp_salary}    ${ru.employment_type}</p>
		       <p>${(ru.major_name!="null")?string(ru.major_name,"")}    ${ru.school_name }</p>
		      </span>
		      <#if ru.head_img?? && ru.head_img!="null" && ru.head_img!="">
		      <span class="studentinfo_r2"><img src="${ru.head_img }" alt="用户头像" onerror="javascript:this.src='${base}/resources/images/usertx.png'" class="uertx"/></span>
		      <#else>
		      <span class="studentinfo_r2"><img src="${base}/resources/images/usertx.png" alt="用户头像" class="uertx"/></span>
		     </#if>
		      </a>
		     </div>
		    <!--/.001-->
   		</#list>
   	<#else>
   		<p class="nodata">${message }</p>
   </#if>
    
   </li>
   <li>
    <#if result gt 0>
    <#if page gt 1>
    <button type="submit" class="pagebtn pagebtnother prew">上一页</button>
    <#else>
    <button type="submit" class="pagebtn">上一页</button>
    </#if>
    
    <#if result lt 20>
    <button type="submit" class="pagebtn">下一页</button>
    <#else>
    <button type="submit" class="pagebtn pagebtnother next">下一页</button>
    </#if>
    </#if>
   </li>
   
  </ul>
 </div>
 <!--/.studentinfo-->

</div>
<!--/.contaniner-->
    

<!--footer-->
 <#include "../common/bottom.ftl">
<!--/.footer--> 

<!--加边框鼠标事件-->
 <script type="text/javascript">
 	$(function(){
 		getJson_education(1);
		getJson_job_type(1);
		getJson_work_experience(1);
		getJson_major(1);
		getJson_city(1);
		
		//下一页
		$(".next").click(function(){
			var page=parseInt('${page}')+1;
			var reqUrl = "${base}/search?pageNo="+page;
			$('#searchForm').attr("action", reqUrl).submit();
		})
		
		//上一页
		$(".prew").click(function(){
			var page=parseInt('${page}')-1;
			var reqUrl = "${base}/search?pageNo="+page;
			$('#searchForm').attr("action", reqUrl).submit();
		})
		
		//专业联动
		$("#major_list").change(function(){
			getJson_child_major($(this).val(),0);
		})
 	});
 	
 	
 	function ShowBorder(studentinfotip){
    	studentinfotip.style.border = "solid 1px #0089e9";
 	};
 	function HideBorder(studentinfotip){
    	studentinfotip.style.border = "solid 1px #e5e5e5";
 	};
 	
 	//学历
	function getJson_education(type){//type:重置标识 0-初始化 1-接受值
	    	var reqURL="${base}/resources/json/education.json";
	    	$.getJSON(reqURL,function(data){
	    		$("#education").empty();
	    		$("#education").append("<option value='-1' selected='selected'>不限</option>");
				$(data).each(function(){
					if(type==0){
						$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
					}else{
						if(this.label == '${education}'){
							$option = $("<option value='"+this.label+"' selected>"+this.value+"</option>");
						}else{
							$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
						}
					}
					
					$("#education").append($option);
				})
			});
	};
	
	//职位类型
	function getJson_job_type(flag){
	    	var reqURL="${base}/resources/json/job_type.json";
	    	$.getJSON(reqURL,function(data){
	    		$("#job_type").empty();
	    		$("#job_type").append("<option value='-1' selected>不限</option>");
				$(data).each(function(){
					if(flag==0){
						$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
					}else{
						if(this.label == '${job_type}'){
							$option = $("<option value='"+this.label+"' selected='selected'>"+this.value+"</option>");
						}else{
							$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
						}
					}
					$("#job_type").append($option);
				})
			});
	};
	
	//工作经验
	function getJson_work_experience(type){
	    	var reqURL="${base}/resources/json/work_experience.json";
	    	$.getJSON(reqURL,function(data){
	    		$("#work_experience").empty();
	    		$("#work_experience").append("<option value='0' selected>不限</option>");
				$(data).each(function(){
					if(type==0){
						$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
					}else{
						if(this.label == '${work_experience}'){
							$option = $("<option value='"+this.label+"' selected='selected'>"+this.value+"</option>");
						}else{
							$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
						}
					}
					$("#work_experience").append($option);
				})
			});
	};
	
	//专业列表-1
	function getJson_major(type){
		var reqURL="${base}/major_list";
    	$.getJSON(reqURL,function(data){
    		$("#major_list").empty();
    		$("#major_list").append("<option value='0'>不限</option>");
			$(data.data).each(function(){
				if(type==0){
					if(this.name!="其他"){
						$("#major_list").append("<option value='"+this.id+"'>"+this.name+"</option>");
					}
				}else{
					if(this.id == '${parent_id}'){
						if(this.name!="其他"){
							$("#major_list").append("<option selected='selected' value='"+this.id+"'>"+this.name+"</option>");
						}
					}else{
						if(this.name!="其他"){
							$("#major_list").append("<option value='"+this.id+"'>"+this.name+"</option>");
						}
					}
				}
			})
			if('${parent_id}'!=0){
				getJson_child_major('${parent_id}',type);
			}
		});
	}
	
	//专业列表-2
	function getJson_child_major(id,type){
		var reqURL="${base}/major_list";
		if(id!=0){
	    	$.getJSON(reqURL,{
	    		id : id
	    	},function(data){
	    		$("#child_major").empty();
	    		$("#child_major").append("<option selected='selected' value='0'>不限</option>");
				$(data.data).each(function(){
					if(type==0){
						$("#child_major").append("<option value='"+this.id+"'>"+this.name+"</option>");
					}else{
						if(this.id=='${major_id}'){
							$("#child_major").append("<option value='"+this.id+"' selected>"+this.name+"</option>");
						}else{
							$("#child_major").append("<option value='"+this.id+"'>"+this.name+"</option>");
						}
					}
				})
			});
		}else{
			$("#child_major").empty();
    		$("#child_major").append("<option selected='selected' value='0'>不限</option>");
		}
	}
	
	
	//城市列表
	function getJson_city(type){
		var reqURL="${base}/city_list";
    	$.getJSON(reqURL,function(data){
    		$("#city").empty();
    		$("#city").append("<option selected='selected' value='0'>不限</option>");
			$(data.data).each(function(){
				if(type==0){
					$("#city").append("<option value='"+this.id+"'>"+this.name+"</option>");
				}else{
					if(this.id == '${city}'){
						$("#city").append("<option selected='selected' value='"+this.id+"'>"+this.name+"</option>");
					}else{
						$("#city").append("<option value='"+this.id+"'>"+this.name+"</option>");
					}
				}
			})
		});
	}
	function erroremergentMsg(){
		layer.alert("您还没有通过企业审核，请到个人中心提交企业资料 ", {icon: 0,skin: 'layer-ext-moon'});
	}
	
	//搜索功能
	function search(){
		if($("#major_list option:selected").val() !=0 && $("#child_major option:selected").val()==0){
			layer.alert("请选择二级专业", {icon: 0,skin: 'layer-ext-moon'});
		}else{
			$('#searchForm').submit();
		}
	}
	
	//重置事件
	function search_reset(){
		getJson_education(0);
		getJson_job_type(0);
		getJson_work_experience(0);
		getJson_major(0);
		getJson_city(0);
		getJson_salary();
		$("#child_major").empty();
		$("#child_major").append("<option selected='selected' value='0'>不限</option>");
	}
	
	function getJson_salary(){
		$("#salary").empty();
		$("#salary").append("<option value='不限' selected='selected' value='0'>不限</option>");
		$("#salary").append("<option value='1000-2000'>1000-2000</option>");
		$("#salary").append("<option value='2001-4000'>2001-4000</option>");
		$("#salary").append("<option value='4001-7000'>4001-7000</option>");
		$("#salary").append(" <option value='7001-10000'>7001-10000</option>");
		$("#salary").append("<option value='10001-15000'>10001-15000</option>");
		$("#salary").append("<option value='15001-20000'>15001-20000</option>");
		$("#salary").append("<option value='20001-60000'>20001以上</option>");
		$("#salary").append("<option value='1000-20000'>面议</option>");
	}
	
 </script>
<!--/.加边框鼠标事件-->

</body>
</html>